package org.example.contain;

import com.sun.xml.internal.ws.policy.privateutil.PolicyUtils;
import org.example.Model;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Vector;
import java.util.concurrent.CopyOnWriteArrayList;

/**
 * @author Yyming
 * @version 10.0
 * Created by Yyming on 2020/10/20
 */
public class CopyOnWriteListTest {

    public static void main(String[] args)  {
//        CopyOnWriteArrayList<Integer> copy = new CopyOnWriteArrayList<>();
//        copy.add(1);copy.add(2);
//        new Thread(() -> {
//            copy.remove(0);
//        }).start();
//        new Thread(() -> {
//            copy.get(1);
//        }).start();
        CopyOnWriteListTest copyOnWriteListTest = new CopyOnWriteListTest();
        try {
            if (copyOnWriteListTest.ttt() && false) {

            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }


    protected boolean ttt() throws Exception {
        throw new RuntimeException("");
    }

}
